package com.leo.tool.serialize.domain;

import java.io.Serializable;

import com.baidu.bjf.remoting.protobuf.annotation.Protobuf;
import com.leo.tool.serialize.jdk.JdkSerializer;

import lombok.Getter;
import lombok.Setter;
import lombok.SneakyThrows;
import lombok.ToString;

@Getter
@Setter
@ToString(callSuper = true)
public class Person extends Parent implements Serializable, Cloneable {

    // 序列化版本号
    private static final long serialVersionUID = 1L;

    @Protobuf
    public static int id;

    @Protobuf
    public transient int seq;

    @Protobuf
    private String name;

    @Protobuf
    private int age;

    @Protobuf
    private Gender gender;

    @SneakyThrows
    @Override
    public Person clone() {
        return (Person)super.clone();
    }

    @SneakyThrows
    public Person deepClone() {
        return JdkSerializer.deserialize(JdkSerializer.serialize(this));
    }

}
